
<%@ page import="projetstackoverflow.Author" %>
<%@ page import="projetstackoverflow.Question" %>
<%@ page import="projetstackoverflow.Answer" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'author.label', default: 'Author')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<div id="list-author" class="content" role="main">
			<h1><g:message code="author.list.label" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:each in="${authorInstanceList}" status="i" var="authorInstance">
				<div class="author">
					<g:link controller="author" action="show" id="${authorInstance.id}" class="${authorInstance.admin?'admin':''}">${authorInstance.pseudo }</g:link><br />
					<g:message code="author.list.nbQuestions" args ="${[authorInstance.messages.findAll{it instanceof Question}.size()]}"/><br />
					<g:message code="author.list.nbAnswers" args ="${[authorInstance.messages.findAll{it instanceof Answer}.size() ]}"/><br />
					<g:message code="author.list.memberSince" args ="${[authorInstance.registrationDate ]}"/><br />
					<g:message code="author.reputation.label"/> : ${authorInstance.computeReputation() }
				</div>
			</g:each>
		</div>
		<div class="pagination">
			<g:paginate total="${authorInstanceTotal}" />
		</div>
	</body>
</html>
